import axios from 'axios';

// 树形列表
let tree_list = (type, params) => axios.get(`/product/category/tree/${type}`, { params });

// 分类列表
let cate_list = (params) => axios.get('/product/category', { params });

// 修改状态
let set_status = (id, is_show, data) => axios.put(`/product/category/set_show/${id}/${is_show}`, data);

// 编辑表单
let edit_cate_form = (id, params) => axios.get(`/product/category/${id}`, { params });

// 分类编辑
let cate_edit = (id, data) => axios.put(`/product/category/${id}`, data);

// 新增表单
let add_cate_list = (params) => axios.get('/product/category/create', { params });

// 分类添加
let add_cate = (data) => axios.post('/product/category', data);

// 分类删除
let cate_del = (id, params) => axios.delete(`/product/category/${id}`, { params });

export default {
    tree_list,
    cate_list,
    set_status,
    edit_cate_form,
    cate_edit,
    add_cate_list,
    add_cate,
    cate_del,
}